//我的空间--修改动态（编辑）：/change-dynamic
import http from 'k6/http';
import { sleep } from 'k6';
import { URL } from './config.js';

export const options = {
    vus:1000,
    duration:'60s'
};

export default function () {
    const url=`${URL}/api/change-dynamic`;
    const payload=JSON.stringify(
       {
        "dynamicId":"dynamica79a7cf4-6612-45b1-be9b-98827261e222",
        "dynamicType":"words",
        "changeType":"edit",
        "createType":"",
        "content":[{"type":"text","value":"今天都是红的吗"}],
        "text":"今天都是红的吗",
        "auth":"all",
        "fileIds":[],
        "collection":"",
        "imgSizeMap":[],
        "nickName":"小小una",
        "strategyId":"",
        "ringId":"",
        "ringName":"",
        "fundTags":[],
        "indexTags":[],
        "unionId":"o896o5_scUqyJKkRTR1z9Wbm4V98",
        "version":"3.4.0.X"}
    );
  const res = http.post(url,payload,{headers:{'Content-Type': 'application/json' }});
  console.log('状态码:', res.status);   // 200
  console.log('返回体:', res.body);     // 原始字符串
  // sleep() 函数作为多个串联请求的思考时间
  sleep(1);
}